<template>
	<div>
		<!-- 顶部选项卡 -->
		<scroll-view class="pagecontrol-top-scroll" scroll-x="true" scroll-with-animation :scroll-into-view="scrollInto">
		    <view class="pagecontrol-top-title">
		        <view v-for="(items, index) in itemsArr" :key="index" class="pagecontrol-top-text" @click="changeTab(index)" :id="'tab' + index">
		            <view :class="tabIndex === index ? 'pagecontrol-top-selected' : 'pagecontrol-top-normal'">{{ items }}</view>
		            <view class="pagecontrol-bottom-line" :class="tabIndex === index ? 'pagecontrol-bottom-line-show' : 'pagecontrol-bottom-line-visibility'"></view>
		        </view>
		    </view>
		</scroll-view>
		<!-- 内容 -->
		<swiper :duration="150" :current="tabIndex" @change="onChangeTab" :style="'height:' + scrollH + 'px;'">
		    <swiper-item>
		        <scroll-view scroll-y="true" show :style="'height:' + scrollH + 'px;'" @scrolltolower="scrolltolower('waybill')">
					<!--运单-->
					<!-- <view style="background-color: #d7d7d7;height: 80px;display: flex;align-items: center;">
						<button hover-class="buttonHover" type="primary"
							style="color:#ffffff;background-color:#bf5f09;width: 100px;height: 35px;font-size: 14px;">车辆调度</button>
					</view> -->
					<view style="background-color: #ffffff;margin-bottom: 10px;margin: 10px;" v-for="(item,index) in wayBillList" :key="index">
						<uni-collapse>
							<uni-collapse-item titleBorder="none" :border="false" :show-arrow="false" :open="true" :disabled="disabled">
								<template v-slot:title>
									<!--如果当前运单状态为待提交、待提货就不显示，否则显示该运单关联信息-->
									<view v-if="item.scheduleStatus!='0'&&item.scheduleStatus!='440'" @click="disabled=false" style="background-image: linear-gradient(to right, #9f9184 0%, #e4e0db 100%);display: flex;flex-direction: column;padding: 10px;border-radius: 12px;">
										<view style="display: flex;justify-content: space-between;">
											<text>{{item.scheduleNo}}</text>
											<text style="color: #eb884c;">{{scheduleStatus[item.scheduleVo.flowStatus]}}</text>
										</view>
										<view>计划发车时间:{{item.scheduleVo.estDepartTime||'--'}}</view>
										<view style="display: flex;justify-content: space-between;">
											<text>{{item.scheduleVo.driverVo.driverName}}/{{item.scheduleVo.driverVo.phoneNumber}}</text>
											<text>{{item.scheduleVo.carVo.licensePlate}}</text>
										</view>
										<view style="display: flex;font-size: 12px;margin: 5px 0;">
											<!-- <text style="background-color: #6699ff;color: #ffffff;padding: 2px 5px;border-radius: 6px;">{{headType[item.scheduleVo.carVo.headType]}}</text> -->
											<text style="background-color: #00cc99;color: #ffffff;padding: 2px 5px;border-radius: 6px;">{{carType[item.scheduleVo.carVo.carType]}}{{item.scheduleVo.carVo.carLength}}米</text>
											<text style="background-color: #0099ff;color: #ffffff;padding: 2px 5px;border-radius: 6px;margin-left: 5px;">{{item.scheduleVo.carVo.loadCapacity}}吨 {{item.scheduleVo.carVo.volume}}立方米</text>
											<!-- <text style="background-color: #d5892e;color: #ffffff;padding: 2px 5px;border-radius: 6px;margin-left: 5px;">0吨-0% 00立方米-0%</text> -->
										</view>
										<view style="display: flex;justify-content: space-between;">
											<span>
												<text>发车点:发货地址</text>
												<text style="font-weight: bold;">（{{item.shipDistrictName}}）</text>
											</span>
											<!-- <view @click.stop="disabled=true" hover-class="buttonHover" style="width: 60px;height: 20px;text-align: center;background-color:#ffffff;color:#0099ff;border-radius: 8px;font-size: 12px;">取消调度</view> -->
										</view>
									</view>
								</template>
								<!--运单部分-->
								<view @click="toWaybillDetails(item.waybillId,item.status)" style="background-color: #ffffff;display: flex;flex-direction: column;padding: 10px;border-bottom: 1px solid #ededed;">
									<view style="display: flex;justify-content: space-between;">
										<span>
											<text>{{item.outCode}}</text>
											<!-- <text style="margin-left: 10px;">{{waybillType[item.waybillType]}}</text> -->
											<!-- <text style="margin-left: 10px;border: 1px solid #eb884c;text-align: center;color: #eb884c;">转</text> -->
										</span>
										<text v-if="item.status=='101'" style="color: #0099ff;">草稿</text>
										<text style="color: #eb884c;">{{status[item.status]}}</text>
									</view>
									<view style="display: flex;justify-content: space-between;color: #6f6f6f;">
										<span style="display: flex;flex-direction: column;">
											<text>{{item.shipName}}</text>
											<text style="font-weight: bold;">{{item.shipDistrictName}}</text>
										</span>
										<text style="display: flex;align-items: center;">→</text>
										<span style="display: flex;flex-direction: column;">
											<text>{{item.deliveryName}}</text>
											<text style="font-weight: bold;">{{item.deliveryDistrictName}}</text>
										</span>
									</view>
									<scroll-view style="white-space: nowrap;width: 100%;margin-top: 5px;" scroll-x="true">
										<span v-for="(item2,index2) in item.goodSourceList" :key="index2" style="display: inline-block;margin-left: 5px;">
											<text style="background-color: #6699ff;color: #ffffff;padding: 2px 5px;border-radius: 6px;">{{item2.goodsName}}</text>
											<text style="background-color: #00cc99;color: #ffffff;padding: 2px 5px;border-radius: 6px;margin-left: 5px;">{{item2.num||'0'}}件 {{item2.weight||'0'}}吨 {{item2.bulk||'0'}}立方米</text>
										</span>
									</scroll-view>
									<!-- <view v-for="(item2,index2) in item.goodSourceList" :key="index2" style="display: flex;font-size: 12px;margin: 5px 0;">
										<text style="background-color: #6699ff;color: #ffffff;padding: 2px 5px;border-radius: 6px;">{{item2.goodsName}}</text>
										<text style="background-color: #00cc99;color: #ffffff;padding: 2px 5px;border-radius: 6px;margin-left: 5px;">{{item2.num}}件 {{item2.weight}}吨 {{item2.bulk}}立方米</text>
									</view> -->
									<view v-if="item.shipPlanTime||item.deliveryPlanTime" style="display: flex;justify-content: space-between;font-size: 13px;">
										<span style="display: flex;flex-direction: column;text-align: center;">
											<text>计划提货时间:</text>
											<text>{{item.shipPlanTime||'--'}}</text>
										</span>
										<span style="display: flex;flex-direction: column;text-align: center;">
											<text>计划到达时间:</text>
											<text>{{item.deliveryPlanTime||'--'}}</text>
										</span>
									</view>
								</view>
							</uni-collapse-item>
							
						</uni-collapse>
						
						
					</view>
					<uni-load-more status="more" :status="loadMoreStatus" @clickLoadMore="scrolltolower('waybill')"></uni-load-more>
					<view style="height: 100px;"></view>
					
					<view class="position" @click="addWaybill" hover-class="buttonHover" style="position: fixed;margin: 0 auto;left:0;right:0;bottom:10px;width: 80px;height:30px;color:#ffffff;background-color:#bf5f09;;border-radius: 4px;display:flex;justify-content: center;align-items: center;">
						新增&ensp;+
					</view>
		        </scroll-view>
		    </swiper-item>
			<swiper-item>
			    <scroll-view scroll-y="true" show :style="'height:' + scrollH + 'px;'"  @scrolltolower="scrolltolower('return')">
					<!--退货-->
					<view style="background-color: #ffffff;margin-bottom: 10px;margin: 10px;" v-for="(item,index) in returnList" :key="index">
						<uni-collapse>
							<uni-collapse-item titleBorder="none" :border="false" :show-arrow="false" :open="true" :disabled="disabled">
								<template v-slot:title>
									<!--如果当前运单状态为待提交、待提货就不显示，否则显示该运单关联信息-->
									<view v-if="item.scheduleStatus!='0'&&item.scheduleStatus!='440'" @click="disabled=false" style="background-image: linear-gradient(to right, #9f9184 0%, #e4e0db 100%);display: flex;flex-direction: column;padding: 10px;border-radius: 12px;">
										<view style="display: flex;justify-content: space-between;">
											<text>{{item.scheduleNo}}</text>
											<text style="color: #eb884c;">{{scheduleStatus[item.scheduleVo.flowStatus]}}</text>
										</view>
										<view>计划发车时间:{{item.scheduleVo.estDepartTime||'--'}}</view>
										<view style="display: flex;justify-content: space-between;">
											<text>{{item.scheduleVo.driverVo.driverName}}/{{item.scheduleVo.driverVo.phoneNumber}}</text>
											<text>{{item.scheduleVo.carVo.licensePlate}}</text>
										</view>
										<view style="display: flex;font-size: 12px;margin: 5px 0;">
											<!-- <text style="background-color: #6699ff;color: #ffffff;padding: 2px 5px;border-radius: 6px;">{{headType[item.scheduleVo.carVo.headType]}}</text> -->
											<text style="background-color: #00cc99;color: #ffffff;padding: 2px 5px;border-radius: 6px;">{{carType[item.scheduleVo.carVo.carType]}}{{item.scheduleVo.carVo.carLength}}米</text>
											<text style="background-color: #0099ff;color: #ffffff;padding: 2px 5px;border-radius: 6px;margin-left: 5px;">{{item.scheduleVo.carVo.loadCapacity}}吨 {{item.scheduleVo.carVo.volume}}立方米</text>
											<!-- <text style="background-color: #d5892e;color: #ffffff;padding: 2px 5px;border-radius: 6px;margin-left: 5px;">0吨-0% 00立方米-0%</text> -->
										</view>
										<view style="display: flex;justify-content: space-between;">
											<span>
												<text>发车点:发货地址</text>
												<text style="font-weight: bold;">（{{item.shipDistrictName}}）</text>
											</span>
											<!-- <view @click.stop="disabled=true" hover-class="buttonHover" style="width: 60px;height: 20px;text-align: center;background-color:#ffffff;color:#0099ff;border-radius: 8px;font-size: 12px;">取消调度</view> -->
										</view>
									</view>
								</template>
								<!--运单部分-->
								<view @click="toReturnWaybillDetails(item.waybillId,item.status)" style="background-color: #ffffff;display: flex;flex-direction: column;padding: 10px;border-bottom: 1px solid #ededed;border-radius: 12px;">
									<view style="display: flex;justify-content: space-between;">
										<span>
											<text>{{item.outCode}}</text>
											<!-- <text style="margin-left: 10px;">{{waybillType[item.waybillType]}}</text> -->
										</span>
										<text style="color: #eb884c;">{{status[item.status]}}</text>
									</view>
									<view style="display: flex;">
										<text style="border: 1px solid #eb884c;text-align: center;color: #eb884c;">原运单:{{item.oldOutCode}}</text>
									</view>
									<view style="display: flex;justify-content: space-between;color: #6f6f6f;">
										<span style="display: flex;flex-direction: column;">
											<text>{{item.shipName}}</text>
											<text style="font-weight: bold;">{{item.shipDistrictName}}</text>
										</span>
										<text style="display: flex;align-items: center;">→</text>
										<span style="display: flex;flex-direction: column;">
											<text>{{item.deliveryName}}</text>
											<text style="font-weight: bold;">{{item.deliveryDistrictName}}</text>
										</span>
									</view>
									<scroll-view style="white-space: nowrap;width: 100%;margin-top: 5px;" scroll-x="true">
										<span v-for="(item2,index2) in item.goodSourceList" :key="index2" style="display: inline-block;margin-left: 5px;">
											<text style="background-color: #6699ff;color: #ffffff;padding: 2px 5px;border-radius: 6px;">{{item2.goodsName}}</text>
											<text style="background-color: #00cc99;color: #ffffff;padding: 2px 5px;border-radius: 6px;margin-left: 5px;">{{item2.num||'0'}}件 {{item2.weight||'0'}}吨 {{item2.bulk||'0'}}立方米</text>
										</span>
									</scroll-view>
									<!-- <view v-for="(item2,index2) in item.goodSourceList" :key="index2" style="display: flex;font-size: 12px;margin: 5px 0;">
										<text style="background-color: #6699ff;color: #ffffff;padding: 2px 5px;border-radius: 6px;">{{item2.goodsName}}</text>
										<text style="background-color: #00cc99;color: #ffffff;padding: 2px 5px;border-radius: 6px;margin-left: 5px;">平板车13米</text>
										<text style="background-color: #0099ff;color: #ffffff;padding: 2px 5px;border-radius: 6px;margin-left: 5px;">{{item2.num}}件 {{item2.weight}}吨 {{item2.bulk}}立方米</text>
									</view> -->
									<view v-if="item.shipPlanTime||item.deliveryPlanTime" style="display: flex;justify-content: space-between;font-size: 13px;">
										<span style="display: flex;flex-direction: column;text-align: center;">
											<text>计划提货时间:</text>
											<text>{{item.shipPlanTime||'--'}}</text>
										</span>
										<span style="display: flex;flex-direction: column;text-align: center;">
											<text>计划到达时间:</text>
											<text>{{item.deliveryPlanTime||'--'}}</text>
										</span>
									</view>
								</view>
							</uni-collapse-item>
							
						</uni-collapse>

					</view>
					<uni-load-more status="more" :status="loadMoreStatus" @clickLoadMore="scrolltolower('return')"></uni-load-more>
					<view style="height: 100px;"></view>
					
					<view @click="addReturnWaybill" hover-class="buttonHover" style="position: fixed;margin: 0 auto;left:0;right:0;bottom:10px;width: 80px;height:30px;color:#ffffff;background-color:#bf5f09;;border-radius: 4px;display:flex;justify-content: center;align-items: center;">
						新增&ensp;+
					</view>
			    </scroll-view>
			</swiper-item>
			<swiper-item>
			    <scroll-view scroll-y="true" show :style="'height:' + scrollH + 'px;'" @scrolltolower="scrolltolower('dispatch')">
					<!--车次-->
					<view style="background-color: #ffffff;margin-bottom: 10px;margin: 10px;border-radius: 24px 0 24px;" v-for="(item,index) in dispatchList" :key="index">
						<!--运单关联车次信息-->
						<view  @click="toDispatchDetails(item.scheduleId)" style="background-image: linear-gradient(to right, #9f9184 0%, #e4e0db 100%);display: flex;flex-direction: column;padding: 10px;border-radius: 24px 0 24px;">
							<view style="display: flex;justify-content: space-between;">
								<text>{{item.scheduleNo}}</text>
								<text v-if="item.scheduleStatus=='0'" style="color: #eb884c;">未调度</text>
								<text v-else style="color: #eb884c;">{{scheduleStatus[item.flowStatus]}}</text>
							</view>
							<view>计划发车时间:{{item.estDepartTime||'--'}}</view>
							<view style="display: flex;justify-content: space-between;">
								<text>{{item.driverVo.driverName}}/{{item.driverVo.phoneNumber}}</text>
								<text>{{item.carVo.licensePlate}}</text>
							</view>
							<view style="display: flex;font-size: 12px;margin: 5px 0;">
								<!-- <text style="background-color: #6699ff;color: #ffffff;padding: 2px 5px;border-radius: 6px;">{{headType[item.carVo.headType]}}</text> -->
								<text style="background-color: #00cc99;color: #ffffff;padding: 2px 5px;border-radius: 6px;">{{carType[item.carVo.carType]}}{{item.carVo.carLength}}米</text>
								<text style="background-color: #0099ff;color: #ffffff;padding: 2px 5px;border-radius: 6px;margin-left: 5px;">{{item.carVo.loadCapacity}}吨 {{item.carVo.volume}}立方米</text>
								<!-- <text style="background-color: #d5892e;color: #ffffff;padding: 2px 5px;border-radius: 6px;margin-left: 5px;">0吨-0% 00立方米-0%</text> -->
							</view>
							<!-- <view style="display: flex;">
								<text v-for="(item_,index_) in item.lineVo.stationList" :key="index_">{{item_.branchDept.deptName}}→</text>
								<text>{{item.lineVo?item.lineVo.stationList.map(i=>i.branchDept?i.branchDept.deptName:'').join('→'):''}}</text>
							</view> -->
						</view>
						<!--运单部分-->
						<view v-for="(item2,index2) in item.waybillList" :key="index2">
							<view @click="toWaybillDetails(item2.waybillId,item2.status)" style="background-color: #ffffff;display: flex;flex-direction: column;padding: 10px;border-bottom: 1px solid #ededed;">
								<view style="display: flex;justify-content: space-between;">
									<span>
										<text>{{item2.outCode}}</text>
										<!-- <text style="margin-left: 10px;">{{waybillType[item2.waybillType]}}</text> -->
										<!-- <text style="margin-left: 10px;border: 1px solid #eb884c;text-align: center;color: #eb884c;">转</text> -->
									</span>
									<text v-if="item2.status=='101'" style="color: #0099ff;">草稿</text>
									<text style="color: #eb884c;">{{status[item2.status]}}</text>
								</view>
								<view style="display: flex;justify-content: space-between;color: #6f6f6f;">
									<span style="display: flex;flex-direction: column;">
										<text>{{item2.shipName}}</text>
										<text style="font-weight: bold;">{{item2.shipDistrictName}}</text>
									</span>
									<text style="display: flex;align-items: center;">→</text>
									<span style="display: flex;flex-direction: column;">
										<text>{{item2.deliveryName}}</text>
										<text style="font-weight: bold;">{{item2.deliveryDistrictName}}</text>
									</span>
								</view>
								<scroll-view style="white-space: nowrap;width: 100%;margin-top: 5px;" scroll-x="true">
									<span v-for="(item_,index_) in item2.goodSourceList" :key="index_" style="display: inline-block;margin-left: 5px;">
										<text style="background-color: #6699ff;color: #ffffff;padding: 2px 5px;border-radius: 6px;">{{item_.goodsName}}</text>
										<text style="background-color: #00cc99;color: #ffffff;padding: 2px 5px;border-radius: 6px;margin-left: 5px;">{{item_.num||'0'}}件 {{item_.weight||'0'}}吨 {{item_.bulk||'0'}}立方米</text>
									</span>
								</scroll-view>
								<!-- <view v-for="(item_,index_) in item2.goodSourceList" :key="index_" style="display: flex;font-size: 12px;margin: 5px 0;">
									<text style="background-color: #6699ff;color: #ffffff;padding: 2px 5px;border-radius: 6px;">{{item_.goodsName}}</text>
									<text style="background-color: #00cc99;color: #ffffff;padding: 2px 5px;border-radius: 6px;margin-left: 5px;">{{item_.num}}件 {{item_.weight}}吨 {{item_.bulk}}立方米</text>
								</view> -->
								<view v-if="item2.shipPlanTime||item2.deliveryPlanTime" style="display: flex;justify-content: space-between;font-size: 13px;">
									<span style="display: flex;flex-direction: column;text-align: center;">
										<text>计划提货时间:</text>
										<text>{{item2.shipPlanTime||'--'}}</text>
									</span>
									<span style="display: flex;flex-direction: column;text-align: center;">
										<text>计划到达时间:</text>
										<text>{{item2.deliveryPlanTime||'--'}}</text>
									</span>
								</view>
							</view>
						</view>
					</view>
					<uni-load-more status="more" :status="loadMoreStatus" @clickLoadMore="scrolltolower('dispatch')"></uni-load-more>
					<view style="height: 100px;"></view>
			    </scroll-view>
			</swiper-item>
		</swiper>
		<!--引导页-->
		<guide :index="2"></guide>
	</div>
</template>

<script>
	import {
		getWayBillList,
		deleteWayBill
	} from '@/api/system/waybill.js'
	import {
		getReturnList,
		deleteReturn
	} from '@/api/system/return.js'
	import {
		getDispatchCarList
	} from '@/api/system/dispatch.js'
	import {getDicts} from '@/api/system/dict.js'
	import guide from '@/components/guide/guide.vue'
	
	export default {
		components: {
			guide
		},
		data() {
			return {
				itemsArr: ['运单','退货','车次'],
				 tabIndex: 0,
				 scrollH: 700,
				 scrollInto: '',
				 disabled:false,
				 
				 //运单列表
				 wayBillList:[],
				 //退货列表
				 returnList:[],
				 //车次列表
				 dispatchList:[],
				 
				 //运单类型
				 waybillType:[],
				 //车辆调度状态
				 scheduleStatus:[],
				 //车头
				 headType:[],
				 //车型
				 carType:[],
				 //运单状态
				 status:[],
				 
				 //运单列表页面大小
				 pageNum_waybill:10,
				 //退货列表页面大小
				 pageNum_return:10,
				 //车次列表页面大小
				 pageNum_dispatch:10,
				 
				 //上拉触底节流标识
				 flag:true,
				 //加载更多
				 loadMoreStatus:'more'
			}
		},
		onLoad(e) {
		    uni.getSystemInfo({
		        success: res => {
		            this.scrollH = res.windowHeight-40;
		        }
		    });
		},
		onShow() {
			switch (this.tabIndex) {
				case 0:
					//加载运单列表
					this.getWayBillList()
					break;
				case 1:
					//加载退货单列表
					this.getReturnList()
					break;
				case 2:
					//加载车次列表
					this.getDispatchCarList()
					break;
				default:
					break;
			}
		},
		methods: {
			// 触底的时候请求数据，即为上拉加载更多
			scrolltolower(name){
				this.loadMoreStatus='loading'
				if(this.flag){
				    setTimeout(()=>{
						if(name==='waybill'){
							this.pageNum_waybill+=10;
							this.getWayBillList()
						}
						else if(name==='return'){
							this.pageNum_return+=10;
							this.getReturnList()
						}
						else if(name==='dispatch'){
							this.pageNum_dispatch+=10;
							this.getDispatchCarList()
						}
						
				        this.flag = true;
				    },1000);
				}
				this.flag = false;
			},
			//接受提交后跳转的顶部导航栏位置
			otherFun(tabIndex) {
				if(tabIndex){
					uni.showLoading({
						title: '正在加载',
					})
					switch (tabIndex) {
						case '0':
							//加载运单列表
							this.getWayBillList()
							break;
						case '1':
							//加载退货列表
							this.getReturnList()
							break;
						case '2':
							//加载车次列表
							this.getDispatchCarList()
							break;
						default:
							break;
					}
				}else{
					return
				}
			},
			// 切换选项
			changeTab(index) {
				if (this.tabIndex === index) {
					return;
				}
				this.tabIndex = index;
				// 滚动到指定元素
				this.scrollInto = 'tab' + index;
							
				switch (index) {
					case 0:
						//加载运单列表
						this.getWayBillList()
						break;
					case 1:
						//加载退货列表
						this.getReturnList()
						break;
					case 2:
						//加载车次列表
						this.getDispatchCarList()
						break;
					default:
						break;
				}
			},
			// 监听滑动
			onChangeTab(e) {
				uni.showLoading({
					title:'正在加载',
				})
			    this.changeTab(e.detail.current);
			},
			//加载运单列表
			async getWayBillList() {
				//加载运单类型
				getDicts('waybill_type').then(res=>{
					res.data.forEach(item=>{
						this.waybillType[item.dictValue]=item.dictLabel
					})
				})
				//加载车次调度状态
				getDicts('flow_status').then(res=>{
					res.data.forEach(item=>{
						this.scheduleStatus[item.dictValue]=item.dictLabel
					})
				})
				//加载车头状态
				getDicts('head_type').then(res=>{
					res.data.forEach(item=>{
						this.headType[item.dictValue]=item.dictLabel
					})
				})
				//加载车型
				getDicts('car_type').then(res=>{
					res.data.forEach(item=>{
						this.carType[item.dictValue]=item.dictLabel
					})
				})
				//加载运单状态
				getDicts('waybill_status').then(res=>{
					res.data.forEach(item=>{
						this.status[item.dictValue]=item.dictLabel
					})
				})
				
				await getWayBillList({pageNum:1,pageSize:this.pageNum_waybill}).then(res => {
					uni.hideLoading()
					if (res.code == '200') {
						this.wayBillList = res.rows
						this.loadMoreStatus=res.rows.length===this.pageNum_waybill?'more':'noMore'
					} else {
						uni.showToast({
							icon: 'none',
							title: res.msg
						})
					}
				})
			},
			//加载退货列表
			async getReturnList() {
				//退货列表
				await getWayBillList({refund:'1',pageNum:1,pageSize:this.pageNum_return}).then(res => {
					uni.hideLoading()
					if (res.code == '200') {
						this.returnList = res.rows
						this.loadMoreStatus=res.rows.length===this.pageNum_return?'more':'noMore'
					} else {
						uni.showToast({
							icon: 'none',
							title: res.msg
						})
					}
				})
			},
			//加载车次列表
			async getDispatchCarList() {
				//待发车  在途
				await getDispatchCarList({pageNum:1,pageSize:this.pageNum_dispatch}).then(res => {
					uni.hideLoading()
					if (res.code == '200') {
						this.dispatchList = res.rows
						this.loadMoreStatus=res.rows.length===this.pageNum_dispatch?'more':'noMore'
					} else {
						uni.showToast({
							icon: 'none',
							title: res.msg
						})
					}
				})
			},
			//新增运单
			addWaybill(){
				uni.navigateTo({
					url:'/pages-operation/operation/addWaybill/addWaybill'
				})
			},
			//车次详情
			toDispatchDetails(scheduleId){
				uni.navigateTo({
					url:'/pages-operation/operation/dispatchDetails/dispatchDetails?scheduleId='+scheduleId
				})
			},
			//运单详情
			toWaybillDetails(waybillId,status){
				if(status=='100'||status=='101')//待提交
				{
					uni.navigateTo({
						url:'/pages-operation/operation/addWaybill/addWaybill?waybillId='+waybillId
					})
				}
				else
				{
					uni.navigateTo({
						url:'/pages-operation/operation/waybillDetails/waybillDetails?waybillId='+waybillId
					})
				}
				
			},
			//新增退货单
			addReturnWaybill(){
				uni.navigateTo({
					url:'/pages-operation/operation/addReturnWaybill/addReturnWaybill'
				})
			},
			//退货单详情
			toReturnWaybillDetails(waybillId,status){
				if(status=='100'||status=='101')//待提交
				{
					uni.navigateTo({
						url:'/pages-operation/operation/addReturnWaybill/addReturnWaybill?returnWaybillId='+waybillId
					})
				}
				else
				{
					uni.navigateTo({
						url:'/pages-operation/operation/returnWaybillDetails/returnWaybillDetails?returnWaybillId='+waybillId
					})
				}
			}
		},
	}
</script>

<style scoped>
.pagecontrol-top-scroll {
    height: 40px;
    width: 100%;
    white-space: nowrap;
    box-sizing: border-box;
    border-bottom: 1rpx solid #ededed;
	background-color: #f8f8f8;
}

.pagecontrol-top-title {
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: space-around;
}

.pagecontrol-top-text {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.pagecontrol-top-normal {
    color: #656565;
    font-size: 16px;
}

.pagecontrol-top-selected {
    color: #000000;
    font-weight: bold;
    font-size: 16px;
}

.pagecontrol-bottom-line {
    width: 33vw;
    height: 3px;
    margin-top: 8px;
    background-color: #bf5f09;
	border-radius: 11px;
}

.pagecontrol-bottom-line-show {
    visibility: visible;
}

.pagecontrol-bottom-line-visibility {
    visibility: hidden;
}
.buttonHover{
	opacity: 0.6;
}
</style>